﻿namespace Satellite_Calculation
{
    public class Point3D
    {
        public Point3D()
        {

        }

        public Point3D(decimal x, decimal y, decimal z)
        {
            X = x;
            Y = y;
            Z = z;
        }

        /// <summary>
        /// 设置或获取坐标输出的精度
        /// </summary>
        public int Precision { get; set; } = 2;

        private decimal x;
        /// <summary>
        /// X坐标
        /// </summary>
        public decimal X
        {
            get { return x; }
            set { x = value; }
        }

        private decimal y;
        /// <summary>
        /// Y坐标
        /// </summary>
        public decimal Y
        {
            get { return y; }
            set { y = value; }
        }

        private decimal z;
        /// <summary>
        /// Z坐标
        /// </summary>
        public decimal Z
        {
            get { return z; }
            set { z = value; }
        }

        public override string ToString()
        {
            string FormatString = "F" + Precision.ToString();
            return "X=" + X.ToString(FormatString) + ", Y=" + Y.ToString(FormatString) + ", Z=" + Z.ToString(FormatString);
        }

    }
}
